package com.ss.android.topic.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.ViewParent;
import android.widget.AbsListView;
import android.widget.ListView;
import com.handmark.pulltorefresh.library.OverscrollHelper;
import com.ss.android.common.view.ScrollDownLayout;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

public final class a extends ListView {
    private List a;
    private OverscrollHelper b;

    public a(Context arg2, AttributeSet arg3) {
        super(arg2, arg3);
        this.a = new CopyOnWriteArrayList();
        super.setOnScrollListener(new b(this));
    }

    static List a(a arg1) {
        return arg1.a;
    }

    protected final void onAttachedToWindow() {
        super.onAttachedToWindow();
        ViewParent v0 = this.getParent();
        while(v0 != null) {
            if((v0 instanceof ScrollDownLayout)) {
                ((ScrollDownLayout)v0).setAssociatedListView(((AbsListView)this));
            }
            else {
                v0 = v0.getParent();
                continue;
            }

            return;
        }
    }

    protected final boolean overScrollBy(int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9, boolean arg10) {
        if(this.b != null) {
            this.b.overScrollBy(arg3, arg5);
        }

        return super.overScrollBy(arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
    }

    public final void setOnScrollListener(AbsListView.OnScrollListener arg2) {
        this.a.add(arg2);
    }

    public final void setOverScrollListener(OverscrollHelper arg1) {
        this.b = arg1;
    }
}

